lappend auto_path "/media/data/yi/simulation/dev/tkMD/1.1"
package require Data 1.1

Data::read_data new.dat data
foreach col [array names data] {
    array set count [Data::prob $data($col) [Data::createbins 0 360 100]]
    set sum 0.0
    foreach name [array names count] {
	set sum [expr $sum+$count($name)]
    }
    foreach name [array names count] {
	set result($col,$name) [expr double($count($name))/double($sum)]	       
    }    
}
puts "# [lsort [array names data]]"
foreach x [lsort [array names count]] {
    set str "$x "
    foreach col [lsort [array names data]] {
	if [info exist result($col,$x)] { append str "$result($col,$x) "} else {
	    append str "0.000 "
	}
    }
    puts $str
}